home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98c.txt / 000045_icon-group-sender _Wed Sep 23 12:28:05 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id MAA15462
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 23 Sep 1998 12:28:04 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA11839; Wed, 23 Sep 1998 12:27:35 -0700
  7. To: icon-group@optima.CS.Arizona.EDU
  8. Date: Wed, 23 Sep 1998 17:16:05 GMT
  9. From: neitzel@gaertner.de (Martin Neitzel)
  10. Message-Id: <EzqyMu.DDG@gaertner.de>
  11. Organization: Gaertner Datensysteme, Braunschweig, Germany
  12. Sender: icon-group-request@optima.CS.Arizona.EDU
  13. References: <6u4cgj$dhm$0@205.138.136.164>, <6u8t4c$h7f$0@205.138.136.110>
  14. Subject: Re: Novice Question:  how to fill a text box with a directory listing
  15. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  16. Status: RO
  17.  
  18. >   chdir("/opt/oshs/progs/in")
  19. >   dir := open("ls *.jpg", "p")
  20. >   [...]
  21. >   while put(pictlist, read(dir))
  22.  
  23. Works probably great now but might fail next February.  The shell has to
  24. expand "ls *.jpg" and when your collection of pictures grows too big the
  25. limited command line buffer will overflow.  A better programmatic
  26. interface would be:
  27.  
  28. >   dir := open ("find /opt/oshs/progs/in -name '*.jpg'", "p")
  29.  
  30. See the manual page for find(1) if you need to restrict the
  31. search to just the first directory level and zillions of other
  32. paraphernalia.  The important point is that the rest remains
  33. as is:
  34.     read(dir)
  35. will return the filenames.  Depending on how you invoke "find",
  36. you have to strip the pathname away, but hey, piecocake in Icon.
  37.  
  38. Caveat:  My Icon is way too rusty to say whether it provides something
  39. special for searching files without a separate process.
  40.  
  41.                         Martin Neitzel
  42.